//    Copyright (C) Kherty.  All rights reserved.
namespace OpenLS.Spreadsheet
{
    class Pair<T1, T2>
    {
        public Pair()
        {

        }
        public override int GetHashCode()
        {
            int result = 0;
            if (_first != null)
                result += _first.GetHashCode();
            if (_second != null)
                result += _second.GetHashCode();
            return result;
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
                return true;
            var p2 = obj as Pair<T1, T2>;
            if (p2 != null)
                return equals(p2);
            return false;
        }

        private bool equals(Pair<T1, T2> p2)
        {
            return Equals(First, p2.First) && Equals(Second, p2.Second);
        }
        public Pair(T1 first, T2 second)
        {
            _first = first;
            _second = second;
        }
        private T1 _first;

        public T1 First
        {
            get { return _first; }
            set { _first = value; }
        }
        private T2 _second;

        public T2 Second
        {
            get { return _second; }
            set { _second = value; }
        }
	
	
    }
}
